package com.grao.waterschool.human.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.grao.waterschool.human.entiry.vo.SubSystemPage;
import com.grao.waterschool.human.manager.service.ICCDeviceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Tag(name = "ICC设备相关接口/不用操作")
@RestController
@RequestMapping("/device/")
public class ICCDeviceController {

    @Autowired
    private ICCDeviceService iccDeviceService;

    @Operation(summary = "获取设备列表")
    @SaCheckPermission(orRole = {"super-admin, admin"})
    @PostMapping("page")
    public List<Map<String, Object>> getDeviceList(@RequestBody SubSystemPage subSystemPage) throws Exception {
        Integer userId = 18012;

        return iccDeviceService.getDeviceList(userId, subSystemPage);
    }
}
